package com.bingo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bingo.dao.BaseDataMapper;
import com.bingo.dao.SiteMapper;
import com.bingo.entity.BaseData;
import com.bingo.entity.Site;
import com.bingo.service.BaseDataService;
import org.springframework.stereotype.Service;

/**
 * @author Bingo
 * @version 1.0
 * @description 参数服务实现类
 * @date 2024/3/23 7:22
 */

@Service
public class BaseDataServiceImpl extends ServiceImpl<BaseDataMapper, BaseData> implements BaseDataService {


    //根据参数name查询value
    @Override
    public String selectValueByName(String name) {
        QueryWrapper<BaseData> wrapper = new QueryWrapper<>();
        wrapper.eq("name", name);
        BaseData baseData = this.getOne(wrapper);
        if (baseData == null) {
            return null;
        }
        return baseData.getValue();
    }
}
